package com.vip.test.mock;

import java.util.Enumeration;
import java.util.HashMap;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;

import javax.servlet.http.HttpSessionContext;

public class UnitTestHttpSession implements HttpSession {

	public HashMap<String,Object> sessions=new HashMap<String,Object>();
	
	public Object getAttribute(String name) {
		
		return sessions.get(name);
	}

	public Enumeration getAttributeNames() {
		// TODO Auto-generated method stub
		return null;
	}

	public long getCreationTime() {
		// TODO Auto-generated method stub
		return 0;
	}

	public String getId() {
		// TODO Auto-generated method stub
		return null;
	}

	public long getLastAccessedTime() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMaxInactiveInterval() {
		// TODO Auto-generated method stub
		return 0;
	}

	public ServletContext getServletContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Deprecated
	@SuppressWarnings("unchecked")
	public HttpSessionContext getSessionContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Deprecated
	@SuppressWarnings("unchecked")
	public Object getValue(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Deprecated
	@SuppressWarnings("unchecked")
	public String[] getValueNames() {
		// TODO Auto-generated method stub
		return null;
	}

	public void invalidate() {
		// TODO Auto-generated method stub

	}

	public boolean isNew() {
		// TODO Auto-generated method stub
		return false;
	}

	@Deprecated
	@SuppressWarnings("unchecked")
	public void putValue(String arg0, Object arg1) {
		// TODO Auto-generated method stub

	}

	public void removeAttribute(String arg0) {
		// TODO Auto-generated method stub

	}

	@Deprecated
	@SuppressWarnings("unchecked")
	public void removeValue(String arg0) {
		// TODO Auto-generated method stub

	}

	public void setAttribute(String name, Object value) {
		 sessions.put(name, value);

	}

	public void setMaxInactiveInterval(int arg0) {
		// TODO Auto-generated method stub

	}

	/**
	 * @return the sessions
	 */
	public HashMap<String, Object> getSessions() {
		return sessions;
	}

	/**
	 * @param sessions the sessions to set
	 */
	public void setSessions(HashMap<String, Object> sessions) {
		this.sessions = sessions;
	}

}
